<link rel="stylesheet" type="text/css" href="../css/cart.css" />
<?
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" ;

?>
<script language="javascript">
var xmlHttp;
function createXHR(){
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (!xmlHttp) {
		alert('您使用的瀏覽器不支援 XMLHTTP 物件');
		return false;
	}
}

function sendRequest(url){
	createXHR() ;
//	url = 'AD-act.php?action='+act+'&ts='+new Date().getTime()+'&'+getFormValue(f) ;
	xmlHttp.open('GET',url,true) ;
	xmlHttp.onreadystatechange = catchXML ;
	xmlHttp.send(null) ;
}

function catchXML(){
	if (xmlHttp.readyState==4){
		xml=xmlHttp.responseXML;
		if (xmlHttp.status == 200) {
            document.getElementById('s').innerHTML=xmlHttp.responseText ;
//			parent.close_win('c') ;
		}else{
			alert('執行錯誤,代碼:'+xmlHttp.status+'\('+xmlHttp.statusText+'\)');
		}
	}
}

function getFormValue(form){
	var str='',ft,fv;

	for (var i=0;i<form.elements.length;i++){
		fv=form.elements[i];
		ft=fv.type.toLowerCase();

		switch(ft){
			case 'select-one':
				str+=fv.name+'='+escape(fv.value)+'&';
				break;
			case 'radio':
				if (fv.checked){
					str+=fv.name+'='+escape(fv.value)+'&';
				}
				break;
			case 'checkbox':
				if (fv.checked){
					str+=fv.name+'='+escape(fv.value)+'&';
				}
				break;
			case 'text':
				str+=fv.name+'='+encodeURIComponent(fv.value)+'&';
				break;
			case 'password':
				str+=fv.name+'='+encodeURIComponent(fv.value)+'&';
				break;
			case 'hidden':
				str+=fv.name+'='+escape(fv.value)+'&';
				break;
			case 'textarea':
				str+=fv.name+'='+encodeURIComponent(fv.value)+'&';
				break;
			default:
				break;
		}
	}

	return str.split(/\s/).join('')
}

function clear_msg(){
}
</script>
<?
//===========================================================
$path = '../';
include_once($path."common.php");
//===========================================================


//===========================================================
echo "<form method=post id=frm name=frm action=\"prod_act.php\">" ;
echo "<table width=100% height=100 border=0 align=center cellspacing=1 cellpadding=1>" ;
$sql_slist = "select * from stage " ;
$result_slist = mysql_query($sql_slist);
$row_slist=mysql_fetch_object($result_slist);
$no = $row_slist->id ;
$rate_1 = $row_slist->three_rate ;
$rate_2 = $row_slist->six_rate ;
$rate_3 = $row_slist->twelve_rate ;
$rate_4 = $row_slist->tf_rate ;
$fare_limit = $row_slist->fare_limit ;
$fare = $row_slist->fare ;
echo "<input name=txt1 type=hidden size=20 value='$no'>" ;
echo "<tr>" ;
echo "<td align=right>"."3期分期利率</td>" ;
echo "<td align=left><input name=txt2 type=text size=2 maxsize=2 value='$rate_1'>"."%"."</td>" ;
echo "</tr>" ;
echo "<tr>" ;
echo "<td align=right>"."6期分期利率</td>" ;
echo "<td align=left><input name=txt3 type=text size=2 maxsize=2 value='$rate_2'>"."%"."</td>" ;
echo "</tr>" ;
echo "<tr>" ;
echo "<td align=right>"."12期分期利率</td>" ;
echo "<td align=left><input name=txt4 type=text size=2 maxsize=2 value='$rate_3'>"."%"."</td>" ;
echo "</tr>" ;
echo "<tr>" ;
echo "<td align=right>"."24期分期利率</td>" ;
echo "<td align=left><input name=txt5 type=text size=2 maxsize=2 value='$rate_4'>"."%"."</td>" ;
echo "</tr>" ;
echo "<tr>" ;
echo "<td align=right>"."運費管理</td>" ;
echo "<td align=left>金額未超過<input name=txt6 type=text size=5 maxsize=5 value='$fare_limit'>元"."</td>" ;
echo "</tr>" ;
echo "<tr>" ;
echo "<td align=right>"."</td>" ;
echo "<td align=left>"."加收運費"."<input name=txt7 type=text size=5 maxsize=5 value='$fare'>元"."</td>" ;
echo "</tr>" ;

echo "</table>" ;
//===========================================================
$act02 = urlencode("修改利率") ;
//=====================================
echo "<table width=100% border=0 align=center cellspacing=1 cellpadding=1>" ;
echo "<tr><td></td></tr>" ;
echo "<tr>" ;
echo "<td align=right width=50%><input id=action_mod name=action type=button value='修改' onclick=\"if(!confirm('確定修改？')){return false;};sendRequest('prod_act.php?action=$act02&ts='+new Date().getTime()+'&'+getFormValue(this.form));\"></td>" ;
echo "<td align=left width=50%><input name=cls type='button' value='關閉視窗' onclick=\"parent.close_win('c');location.reload();parent.location.reload();\"></td>" ;
echo "<tr>" ;
echo "</table>" ;
//===========================================================
echo "<div id=s align=center></div>" ;
//===========================================================
echo "</form>" ;
?>